package fiveagon.lsystem;

public class Turtle {
  private double x;
  private double y;
  private double angle;

  public Turtle(Turtle t) {
    this(t.x, t.y, t.angle);
  }

  public Turtle(double x, double y, double angle) {
    this.x = x;
    this.y = y;
    this.angle = angle;
  }

  public float getX() {
    return (float) x;
  }

  public float getY() {
    return (float) y;
  }
  
  public float getAngle() {
    return (float) angle;
  }

  public void move(double distance) {
    x += distance * Math.cos(angle);
    y += distance * Math.sin(angle);
  }

  public void rotate(double rotationAngle) {
    angle += rotationAngle;
  }
}
